A file system, in computing, is an arrangement for storing and organizing computer files and the data they contain to make it easy to find and access them. File systems may use a data storage device such as a hard disk or CD-ROM and involve maintaining the physical location of the files, they might provide access to data on a file server by acting as clients for a network protocol, or they may be virtual and exist only as an access method for virtual data. Typical file systems make use of an underlying data storage device that offers access to an array of fixed-size blocks, sometimes called sectors. The file system software is responsible for organizing these sectors into files and directories, and keeping track of which sectors belong to which file and which are not being used.
For file systems that do not support sparse files (i.e. file systems without pointers to address such that blocks can be rearranged) lack a mechanism to transfer data from one file to another in low storage space situations. Challenges in such scenarios include: a change of state of the data (e.g. encrypted, compressed, or otherwise transformed); unpredictable extra space requirement for data and overhead (due to the nature of the transform); the restriction to write the data in-order rather than randomly throughout the file; and recovery from mid-transaction interrupts (e.g. power loss).
Some proposed solutions have their own disadvantages. For example, if the file is simply read into memory, the file deleted, and then written out, mid-transaction power loss may result in the data being lost. If the file is read one block at a time from the beginning, then written out to the new file, the space required is the sum of the old file and the new file sizes, which may be more than the space available on disk.